<template>
  <div class="mittB">
    <h4>我是组件B(发送方)</h4>
    <button @click="fabu">发布通知</button>
  </div>
</template>

<script setup lang="ts">
import Bus from "@/utils/EventBus";

const fabu = () => {
  Bus.emit("message", "大家国庆记得玩的开心！");
};
</script>

<style lang="scss" scoped>
.mittB {
  border: 2px solid hotpink;
  width: 200px;
  height: 200px;
  text-align: center;
}
</style>
